package com.shxc.smarttrade.dialogactivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.shxc.smarttrade.R;
import com.shxc.smarttrade.account.activity.TradingAccountActivity;
import com.shxc.smarttrade.base.NoActionBarBaseActivity;
import com.shxc.smarttrade.old.activity.SelectBrokeOpenAccountActivity;

import org.xchris.view.annotation.ContentView;
import org.xchris.view.annotation.Event;
import org.xchris.view.annotation.ViewInject;

/**
 * 账户到期
 */
@ContentView(R.layout.activity_dialog_acc_expire)
public class AccExpireDialogActivity extends NoActionBarBaseActivity {
    @ViewInject(R.id.open_textview)
    TextView open_textview;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (spImp.getAccStatus() == 1) {
            open_textview.setText("开通真实账户");
        }else{
            open_textview.setText("切换真实账户");
        }
    }

    @Event({R.id.close_imageview, R.id.open_textview})
    private void onClick(View view) {
        switch (view.getId()) {
            case R.id.close_imageview:
                finish();
                break;
            case R.id.open_textview:
                if (spImp.getAccStatus() == 1) {
                    JumpTo(SelectBrokeOpenAccountActivity.class);//旧
                }else{
                    JumpTo(TradingAccountActivity.class);//新
                }
                break;
        }
    }
}
